\(\int \frac {a+b \log (c x^n)}{x} \, dx\) [47]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 22 \[ \int \frac {a+b \log \left (c x^n\right )}{x} \, dx=\frac {\left (a+b \log \left (c x^n\right )\right )^2}{2 b n} \]

[Out]

1/2*(a+b*ln(c*x^n))^2/b/n

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {2338} \[ \int \frac {a+b \log \left (c x^n\right )}{x} \, dx=\frac {\left (a+b \log \left (c x^n\right )\right )^2}{2 b n} \]

[In]

Int[(a + b*Log[c*x^n])/x,x]

[Out]

(a + b*Log[c*x^n])^2/(2*b*n)

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (a+b \log \left (c x^n\right )\right )^2}{2 b n} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.95 \[ \int \frac {a+b \log \left (c x^n\right )}{x} \, dx=a \log (x)+\frac {b \log ^2\left (c x^n\right )}{2 n} \]

[In]

Integrate[(a + b*Log[c*x^n])/x,x]

[Out]

a*Log[x] + (b*Log[c*x^n]^2)/(2*n)

Maple [A] (verified)

Time = 0.09 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.91

method result size
parts \(\ln \left (x \right ) a +\frac {b \ln \left (c \,x^{n}\right )^{2}}{2 n}\) \(20\)
parallelrisch \(\frac {2 \ln \left (x \right ) a n +b \ln \left (c \,x^{n}\right )^{2}}{2 n}\) \(23\)
derivativedivides \(\frac {\frac {b \ln \left (c \,x^{n}\right )^{2}}{2}+\ln \left (c \,x^{n}\right ) a}{n}\) \(25\)
default \(\frac {\frac {b \ln \left (c \,x^{n}\right )^{2}}{2}+\ln \left (c \,x^{n}\right ) a}{n}\) \(25\)
norman \(\frac {a \ln \left (c \,{\mathrm e}^{n \ln \left (x \right )}\right )}{n}+\frac {b \ln \left (c \,{\mathrm e}^{n \ln \left (x \right )}\right )^{2}}{2 n}\) \(31\)
risch \(b \ln \left (x \right ) \ln \left (x^{n}\right )-\frac {b n \ln \left (x \right )^{2}}{2}-\frac {i \ln \left (x \right ) \pi b \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )}{2}+\frac {i \ln \left (x \right ) \pi b \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}+\frac {i \ln \left (x \right ) \pi b \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}-\frac {i \ln \left (x \right ) \pi b \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}+\ln \left (x \right ) \ln \left (c \right ) b +\ln \left (x \right ) a\) \(118\)

[In]

int((a+b*ln(c*x^n))/x,x,method=_RETURNVERBOSE)

[Out]

ln(x)*a+1/2*b/n*ln(c*x^n)^2

Fricas [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.82 \[ \int \frac {a+b \log \left (c x^n\right )}{x} \, dx=\frac {1}{2} \, b n \log \left (x\right )^{2} + {\left (b \log \left (c\right ) + a\right )} \log \left (x\right ) \]

[In]

integrate((a+b*log(c*x^n))/x,x, algorithm="fricas")

[Out]

1/2*b*n*log(x)^2 + (b*log(c) + a)*log(x)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 34 vs. \(2 (15) = 30\).

Time = 1.54 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.55 \[ \int \frac {a+b \log \left (c x^n\right )}{x} \, dx=\begin {cases} a \log {\left (x \right )} & \text {for}\: b = 0 \\- \left (- a - b \log {\left (c \right )}\right ) \log {\left (x \right )} & \text {for}\: n = 0 \\\frac {\left (- a - b \log {\left (c x^{n} \right )}\right )^{2}}{2 b n} & \text {otherwise} \end {cases} \]

[In]

integrate((a+b*ln(c*x**n))/x,x)

[Out]

Piecewise((a*log(x), Eq(b, 0)), (-(-a - b*log(c))*log(x), Eq(n, 0)), ((-a - b*log(c*x**n))**2/(2*b*n), True))

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.91 \[ \int \frac {a+b \log \left (c x^n\right )}{x} \, dx=\frac {{\left (b \log \left (c x^{n}\right ) + a\right )}^{2}}{2 \, b n} \]

[In]

integrate((a+b*log(c*x^n))/x,x, algorithm="maxima")

[Out]

1/2*(b*log(c*x^n) + a)^2/(b*n)

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.86 \[ \int \frac {a+b \log \left (c x^n\right )}{x} \, dx=\frac {1}{2} \, b n \log \left (x\right )^{2} + b \log \left (c\right ) \log \left (x\right ) + a \log \left (x\right ) \]

[In]

integrate((a+b*log(c*x^n))/x,x, algorithm="giac")

[Out]

1/2*b*n*log(x)^2 + b*log(c)*log(x) + a*log(x)

Mupad [B] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.86 \[ \int \frac {a+b \log \left (c x^n\right )}{x} \, dx=a\,\ln \left (x\right )+\frac {b\,{\ln \left (c\,x^n\right )}^2}{2\,n} \]

[In]

int((a + b*log(c*x^n))/x,x)

[Out]

a*log(x) + (b*log(c*x^n)^2)/(2*n)